﻿using Entities;

namespace Api.Controllers
{
    /// <summary>
    /// 在用绳检测
    /// </summary>
    public class CheckWireropeController : EditingBaseController<CheckWireropeModel, CheckWireropeFilterModel, ICheckWireropeLogic>
    {
        public CheckWireropeController(ICurrentUser currentUser, ICheckWireropeLogic logic)
            : base(currentUser, logic)
        {
        }

        ////提交
        //[HttpGet]
        //[Route("{id}")]
        //public async Task<bool> Submit(int id)
        //{
        //    return await Task.Run(() => _logic.Submit(id));
        //}

        [HttpPost]
        public async Task<bool> Check([FromBody] CheckWireropeModel model)
        {
            return await Task.Run(() => _logic.Check(model));
        }

        #region 获取上次检测数据
        [HttpPost]
        public async Task<CheckWireropeModel> GetPrevCheckWireropeModel([FromBody] CheckWireropeFilterModel filterModel)
        {
            return await Task.Run(() => _logic.GetPrevCheckWireropeModel(filterModel));
        } 
        #endregion
    }
}
